<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://www.springframework.org/security/tags" prefix="security" %>
<!-- 查询按钮 -->
<c:set var="SEARCH_BUTTON" value="${CODE_AUTH.session_search_button}"></c:set>
<!-- 是否有查询的权限 -->				
<security:authorize var="HAS_AUTH_SEARCH" access="${SEARCH_BUTTON.SPEL}"></security:authorize>					
<!DOCTYPE html>
<html lang="zh-CN">
<!-- 引入头部 -->
<%@include file="/WEB-INF/include-head.jsp"%>
<link rel="stylesheet" href="css/pagination.css">
<script type="text/javascript" src="jquery/jquery.pagination.js"></script>
<script type="text/javascript" src="crowdfunding/my-session.js"></script>
<script type="text/javascript">
$(function(){
	
	// 1.为分页操作准备初始化数据
	window.pageNum = 1;
	window.pageSize = 5;
	window.keyword = "";
	window.hasAuthSearch = "${HAS_AUTH_SEARCH}";
	if(window.hasAuthSearch == "true"){
		window.searchUrl = "${SEARCH_BUTTON.URL}";
	}
	
	// 2.构建分页并实现页面效果
	generatePage();
	
	// 3.给查询按钮绑定单击响应函数
	$("#searchBtn").click(function(){
		
		// ①给全局变量分页页码赋值为第一页
		window.pageNum = 1;
		
		// ②获取关键字数据赋值给对应的全局变量
		window.keyword = $("#keywordInput").val();
		
		// ③调用分页函数刷新页面
		generatePage();
		
	});
	
});

</script>
<body>
	<!-- 引入导航条 -->
	<%@include file="/WEB-INF/include-nav.jsp"%>
	<div class="container-fluid">
		<div class="row">
			<!-- 引入侧边栏 -->
			<%@include file="/WEB-INF/include-sidebar.jsp"%>
			<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
							<i class="glyphicon glyphicon-th"></i> 数据列表
						</h3>
					</div>
					<div class="panel-body">
						<security:authorize access="${HAS_AUTH_SEARCH}">
							<form class="form-inline" role="form" style="float: left;">
								<div class="form-group has-feedback">
									<div class="input-group">
										<div class="input-group-addon">查询条件</div>
										<input id="keywordInput" class="form-control has-success" type="text"
											placeholder="请输入查询条件">
									</div>
								</div>
								<button id="searchBtn" type="button" 
									class="${SEARCH_BUTTON.BUTTON_CLASS}">
									<i class="${SEARCH_BUTTON.ICON_CLASS}"></i> 查询
								</button>
							</form>
						</security:authorize>
						<br>
						<hr style="clear: both;">
						<security:authorize access="${HAS_AUTH_SEARCH}">
							<div class="table-responsive">
								<table class="table  table-bordered">
									<thead>
										<tr>
											<th width="30">#</th>
											<th>会话编号</th>
											<th>登录名称</th>
											<th>登录时间</th>
											<th>最后访问时间</th>
											<th width="100">操作</th>
										</tr>
									</thead>
									<tbody>
									</tbody>
									<tfoot>
										<tr>
											<td colspan="6" align="center">
											
												<div id="PageInfo" class="pull-left" style="margin: 20px 0;padding: 6px 0;position: absolute;left: 65px;"></div>
												
												<div id="Pagination" class="pagination"><!-- 这里显示分页 --></div>
												
											</td>
										</tr>
	
									</tfoot>
								</table>
							</div>
						</security:authorize>
					</div>
				</div>
			</div>
		</div>
	</div>
	
	
</body>
</html>